package allinpay.yun.demo.order;

import allinpay.yun.demo.DemoUtils;
import allinpay.yun.demo.IDemoHandler;
import org.json.JSONArray;
import org.json.JSONObject;

public class AgentCollectApplySimplifyHandler implements IDemoHandler {
    @Override
    public JSONObject getRequestParams() throws Exception {
        String bizOrderNo = System.currentTimeMillis() + "ds";


        JSONObject quickPayPC = new JSONObject();
        quickPayPC.put("amount", 10);

        JSONObject coupon = new JSONObject();
        coupon.put("amount", 50);

        JSONArray balances = new JSONArray();
        JSONObject balance = new JSONObject();
        balance.put("amount", 40);
        balance.put("accountSetNo","200001");
        balances.put(balance);

        //组装支付方式
        JSONObject payMethod = new JSONObject();
        payMethod.put("QUICKPAY_PC", quickPayPC);
        payMethod.put("COUPON",coupon);
        payMethod.put("BALANCE",balances);


        JSONObject param = new JSONObject();
        param.put("bizOrderNo", bizOrderNo);
        param.put("payerId", "yunDemo001");
//        param.put("goodsType", );
//        param.put("goodsNo", "");
        param.put("tradeCode", "1001");
        param.put("amount", 100);
        param.put("fee", 0);
        param.put("validateType", 1);
        param.put("frontUrl", "http://122.227.225.142:23661/gateway/getPayFront.jsp");
        param.put("backUrl", "http://122.227.225.142:23661/test/recievePayBack.jsp");
//        param.put("ordErexpireDatetime", 0);
        param.put("payMethod", payMethod);
        param.put("goodsName", "test_goodsName");
        param.put("goodsDesc", "test_goodsDesc");
        param.put("industryCode", "1010");
        param.put("industryName", "保险行业");
        param.put("source", 2);
        param.put("summary", "testtest_summar");
        param.put("extendInfo", "this is extendInfo");

        return param;
    }
}
